<script>
	jQuery(function() {
		jQuery( "#article_publish_up" ).datepicker({ dateFormat: 'yy-mm-dd' });
                jQuery( "#article_publish_down" ).datepicker({ dateFormat: 'yy-mm-dd' });
	});
</script>

<%= form_for(@article) do |f| %>
  <% if @article.errors.any? %>
    <div class="notification note-error">
	<a href="#" class="close" title="Close notification">close</a>
	<p><strong><%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:</strong></p>
        <p>
          <% @article.errors.full_messages.each do |msg| %>
            - <%= msg %><br />
          <% end %>
        </p>
    </div>    
  <% end %>
                        

					<table class="style1">
					<thead>
					<tr>

						<th>Item</th>
						<th class="full">Value</th>						
					</tr>
					</thead>
					<tbody>
                                        
                                        <% if !@event.nil? %>
                                          <tr>
                                            <th><%= f.label 'Event' %></th>
                                            <td>
                                              <%= @event.title %>
                                              <input type="hidden" name="article[event_id]" value="<%= @event.id.to_s %>" />
                                            </td>
                                          </tr>
                                        <% end %>
                                        
					<tr>
						<th><%= f.label :title %></th>
						<td class="edit-field edit-textfield long"><%= f.text_field :title %></td>						
					</tr>					
					<tr>
						<th><%= f.label :alias %></th>
						<td class="edit-field edit-textfield long"><%= f.text_field :alias %></td>
					</tr>
					<tr>
						<th><%= f.label :body %></th>
						<td class="edit-field edit-textarea">
                                                  <div style="width: 100px;"><%= f.text_field :body, :class => "tinymce" %></div>
                                                </td>
					</tr>
					<tr>
						<th><%= f.label :article_status %></th>
						<td>
						  <%= select("article", "article_status_id", @article_statuses, {:include_blank => 'None'}) %>
						</td>
					</tr>
					<tr>
						<th>Publishing</th>
						<td>
						  Up: <input type="text" id="article_publish_up" name="article[publish_up]" value="" />
						  Down: <input type="text" id="article_publish_down" name="article[publish_down]" value="" />
						</td>
					</tr>
                                        <tr>
						<th><%= f.label :ordering %></th>
						<td class="edit-field edit-textfield long"><%= f.text_field :ordering %></td>
					</tr>
					</tbody>
					</table>
					
					<div class="tab-footer clear">
						<div class="fr">
                                                        <%= f.submit "Create", :class => 'button' %>
						</div>
					</div>
				
<% end %>